import com.sun.org.apache.xpath.internal.operations.Neg;

import java.util.Arrays;
import java.util.Scanner;

public class Main {
    //存在连续三个奇数的数组
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int[] num=new int[9];
        for (int i = 0; i < num.length; i++) {
            num[i]=in.nextInt();
        }
        boolean bl=true;
        for (int i = 0; i < num.length-2; i++) {
            if (num[i]%2==1){
                if (num[i+1]%2==1&&num[i+2]%2==1){
                    System.out.println(true);
                    bl=false;
                }
            }
        }
        if (bl){
            System.out.println(false);
        }
        in.close();
    }













    //给定一个大小为 n 的数组，找到其中的多数元素。多数元素是指在数组中出现次数 大于 ⌊ n/2 ⌋ 的元素。
    public static void main7(String[] args) {
        Scanner in=new Scanner(System.in);
        int[] num=new int[7];
        for (int i = 0; i < num.length; i++) {
            num[i]=in.nextInt();
        }
        int std=num.length/2;
        for (int i = 0; i < num.length-1; i++) {
            int count=1;
            for (int j = i+1; j < num.length; j++) {
                if (num[i]==num[j]){
                    count++;
                }
                if (count>std){
                    System.out.println(num[i]);
                    break;
                }
            }
        }
        in.close();
    }











    //给定一个非空整数数组，除了某个元素只出现一次以外，其余每个元素均出现两次。找出那个只出现了一次的元素
    public static void main6(String[] args) {
        Scanner in= new Scanner(System.in);
        int[] num=new int[5];
        int result=0;
        for (int i = 0; i < num.length; i++) {
            num[i]=in.nextInt();
            result^=num[i];
        }
        System.out.println(result);

        in.close();
    }












    //给定一个整数数组 nums 和一个整数目标值 target，请你在该数组中找出 和为目标值 target 的那 两个 整数，并返回它们的数组下标
    public static void main5(String[] args) {
        Scanner in=new Scanner(System.in);
        int[] num=new int[10];
        for (int i = 0; i < num.length; i++) {
            num[i]=in.nextInt();
        }
        System.out.println();
        int sr=in.nextInt();
        boolean bl=true;
        for (int i = 0; i < num.length-1; i++) {
            for (int j = i+1; j < num.length; j++) {
                if (num[i]+num[j]==sr){
                    System.out.println(i+" "+j);
                    bl=false;
                }
            }
        }
        if (bl){
            System.out.println(-1);
        }

        in.close();
    }












    //冒泡排序
    public static void main4(String[] args) {
        Scanner in=new Scanner(System.in);
        int[] num=new int[10];
        for (int i = 0; i < num.length; i++) {
            num[i]=in.nextInt();
        }
        for (int i = 0; i < num.length; i++) {
            boolean bl=true;
            for (int j = 0; j < num.length-i-1; j++) {
                if (num[j]>num[j+1]){
                    int temp=num[j];
                    num[j]=num[j+1];
                    num[j+1]=temp;
                    bl=false;
                }
            }
            if (bl){
                break;
            }
        }
        System.out.println(Arrays.toString(num));

        in.close();
    }











    //奇数位于偶数之前
    public static void main3(String[] args) {
        Scanner in=new Scanner(System.in);
        int[] num= new int[6];
        for (int i = 0; i < num.length; i++) {
            num[i]=in.nextInt();
        }
        int[] num2=new int[num.length];
        int left=0;
        int right=num2.length-1;
        for (int i = 0; i < num2.length; i++) {
            if(num[i]%2==1){
                num2[left]=num[i];
                left++;
            } else  {
                num2[right]=num[i];
                right--;
            }
        }
        num=Arrays.copyOf(num2,num2.length);
        System.out.println(Arrays.toString(num));

        in.close();
    }








    //求数组的平均值
    public static void main2(String[] args) {
        Scanner in=new Scanner(System.in);
        int[] num=new int[5];
        for (int i = 0; i < num.length; i++) {
            num[i]=in.nextInt();
        }
        System.out.println(avg(num));
    }

    public static double avg(int[] num){
        int sum=0;
        for (int i = 0; i < num.length; i++) {
            sum+=num[i];
        }
        return ((double) sum)/(num.length);
    }








    //改变原有数组元素的值
    public static void main1(String[] args) {
        Scanner in=new Scanner(System.in);
        int[] num=new int[5];
        for (int i = 0; i < num.length; i++) {
            num[i]=in.nextInt();
        }
        //System.out.println(Arrays.toString(num));
        num=transform(num);
        System.out.println(Arrays.toString(num));

        in.close();
    }

    public static int[] transform(int[] num){
        for (int i = 0; i < num.length; i++) {
            num[i]*=2;
        }
        return num;
    }
}